package lab02.test21;

/**
 * Created by LENOVO on 2017/10/31.
 */
public class TEST {

    public static void main(String[] args) {
        //  说明	统计一个字符串中给定字符出现的频率。

        String string = "rtyuikcvbnm";
        char special = 't';

        int number = 0;
        for (int i = 0; i< string.length(); i++){
            if (string.charAt(i) == special){
                number++;
            }
        }

        System.out.println("在字符rtyuikcvbnm中 t出现的频率为："+number);
    }
}

